/**
 * 用户模块封装api接口
 */
import request from '@/utils/request'

// 注册接口
export const useRegisterService = ({ studentId, email, password, repassword }) => {
  return request.post('http://127.0.0.1:3000/api/user/register', { studentId, email, password, repassword })
}

// 登录接口
export const useLoginService = ({ studentId, email, code, password, loginType }) => {
  return request.post('http://127.0.0.1:3000/api/user/login', { studentId, email, code, password, loginType })
}

// 获取注册id（即创建者id）
export const useGetUserIdService = ({ studentId }) => {
  return request.post('http://127.0.0.1:3000/api/user/getuserid', { studentId })
}

// 发送验证码
export const useSendVerificationCode = ({ email }) => {
  return request.post('http://127.0.0.1:3000/api/user/send-verification-code', { email })
}